﻿using SUNRPA.CONTROLS.IMPL.domain.flowItemParam;
using System.ComponentModel;

namespace SUNRPA.CONTROLS.IMPL.domain {
    
    [Serializable]
    public class FlowItem:INotifyPropertyChanged {
        private string controlName;
        private int index;
        private string editTitle;
        private string editTip;
        private string controlKey;
        private string controlType;
        private BaseParam controlParam;
        private string itemInfo;
        private FlowItem endTag;
        private string parentKey;
        private List<FlowItem> middleTags = new List<FlowItem>();
        public FlowItem() {

        }
        public string ParentKey {get => parentKey; set => parentKey = value;}
        public List<FlowItem> MiddleTags {get {return middleTags;} set { middleTags = value;}}
        public FlowItem EndTag {get {return endTag;} set { endTag = value;}}
        public string EditTitle {get => editTitle; set => editTitle = value;}
        public string EditTip {get => editTip; set => editTip = value;}
        public string ControlName { get => controlName; set { controlName = value; NotifyPropertyChanged("ControlName"); } }
        public string ControlKey { get => controlKey; set { controlKey = value; NotifyPropertyChanged("ControlKey"); } }
        public string ControlType { get => controlType; set { controlType = value; NotifyPropertyChanged("ControlType"); } }
        public BaseParam ControlParam { get => controlParam; set { controlParam = value; NotifyPropertyChanged("ControlParam"); } }

        public string ItemInfo { get => itemInfo; set { itemInfo = value; NotifyPropertyChanged("ItemInfo"); } }

        public int Index { get => index; set => index = value; }

        public event PropertyChangedEventHandler? PropertyChanged;

        public void NotifyPropertyChanged(string propName) {
            if(PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }
    }
}
